<%-- 
    Document   : profilnouveau
    Created on : 20-Aug-2012, 2:25:02 PM
    Author     : James
--%>

<%@page import="application.Facade"%>
<%@page import="application.VillePaysBean"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="controleur.ConstantesWeb"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Nouveau compte</title>
        <link rel="stylesheet" type="text/css" href="<%=ConstantesWeb.CSS_ENTETE%>"/>
        <script type="text/javascript" src="Validation/creerCompte.js"></script>
    </head>
    <body>
        <%
            Facade f = new Facade();
        %>
        <jsp:include page="<%=ConstantesWeb.PAGE_ENTETE%>"/>
        <h1 align="left">Nouveau compte</h1>

        <FORM name="creerCompte" METHOD="POST" ACTION="./Entree" onsubmit="return validerForme('creerCompte')">
            <input type="hidden" name="cmd" value="<%=ConstantesWeb.CMD_CREER_COMPTE%>"/>
            <table width="700" border="2">
                <tr>
                    <td align="left" width = "500">Nom d'utilisateur :</td>
                    <td align="left">
                        <input type="text" name="username" size="<%=ConstantesWeb.BD_STRING_LENGTH%>">
                    </td>
                </tr>            
                <tr>
                    <td align="left">Type de compte :</td>
                    <td align="left">
                        <input type="text" name="utilisateur" size="<%=ConstantesWeb.BD_STRING_LENGTH%>" 
                               disabled="disabled" value="utilisateur">
                        <input type="hidden" name="compte" value="utilisateur"/>
                    </td>
                </tr>
                <tr>                
                    <td align="left"><br>Prénom :</td>
                    <td align="left">
                        <br><input type="text" name="prenom" size="<%=ConstantesWeb.BD_STRING_LENGTH%>">
                    </td>
                </tr>
                <tr>
                    <td align="left">Nom :</td>
                    <td align="left">
                        <input type="text" name="nom" size="<%=ConstantesWeb.BD_STRING_LENGTH%>">
                    </td>
                </tr>
                <tr>
                    <td align="left">Courriel :</td>
                    <td align="left">
                        <input type="text" name="courriel" size="<%=ConstantesWeb.BD_STRING_LENGTH%>">
                    </td>
                </tr>
                <tr>
                    <td align="left">Adresse :</td>
                    <td align="left">
                        <input type="text" name="adresse" size="<%=ConstantesWeb.BD_STRING_LENGTH%>">
                    </td>
                </tr>
                <tr>
                    <td align="left">Téléphone :</td>
                    <td align="left">
                        <input type="text" name="telephone" size="<%=ConstantesWeb.BD_STRING_LENGTH%>">
                    </td>
                </tr>
                <tr>
                    <td align="left">Nouveau mot de passe :</td>
                    <td align="left">
                        <input type="password" name="pwd-nouveau-1" maxlength="<%=ConstantesWeb.BD_STRING_LENGTH%>" size="<%=ConstantesWeb.BD_STRING_LENGTH%>">
                    </td>
                </tr>
                <tr>
                    <td align="left">Confirmer mot de passe :</td>
                    <td align="left">
                        <input type="password" name="pwd-nouveau-2" maxlength="<%=ConstantesWeb.BD_STRING_LENGTH%>" size="<%=ConstantesWeb.BD_STRING_LENGTH%>">
                    </td>
                </tr>
                <tr>
                    <td align="left">Image profile (ex. C:\Images\) :</td>
                    <td align="left">
                        <input type="text" name="image_profil" size="<%=ConstantesWeb.BD_STRING_LENGTH%>"/>
                    </td>
                </tr>
                <tr>
                    <td align="left">Ville :</td>
                    <td align="right">

                        <select lenght="45" name="idVillePays">
                            <%
                                List<VillePaysBean> villesPaysBeanListe = f.getVillesPays();

                                for (VillePaysBean vp : villesPaysBeanListe) {
                                    out.print("<option value=\"" + vp.getIdVillePays() + "\"");
                                    out.print(">" + vp.getVille() + ", " + f.getTypeValeur(vp.getIdPays()));
                                }
                            %>
                        </select>
                    </td>
                </tr>
                <tr>                
                    <td align="right" colspan="2">
                        <button>Sauvegarder</button>                    
                    </td>
                </tr>
            </table>
        </FORM>
    </body>
</html>
